global class Cald_NewDisputeWS {
	static Callidus_Dispute__c disputeObj = null;
	Webservice static Callidus_Dispute__c createDispute(ID oppId)
	{
		disputeObj = new Callidus_Dispute__c(Status__c = 'Draft', Opportunity__c = oppId);
		insert disputeObj;
		return disputeObj;
	}
	
    static testMethod void testCald_NewDisputeWS()
    {
    	Opportunity[] oList = [select id from Opportunity];
    	Callidus_Dispute__c cd = null;
    	if(oList.size() > 0)
    		cd = createDispute(oList[0].id);
    		
    	Callidus_Dispute__c[] cdList = [select Opportunity__c from Callidus_Dispute__c where Opportunity__c = :oList[0].id];
		system.assertEquals(cd.Opportunity__c, cdList[0].Opportunity__c);    	
    }	
}